import request from '@/utils/request'
import { download } from '@/utils/request'

// 新增简答题
export function addJd(data) {
  return request({
    url: '/businessCore/faShortAnswerQuestions',
    method: 'post',
    data
  })
}

// 修改简答题
export function updateJd(data) {
  return request({
    url: '/businessCore/faShortAnswerQuestions',
    method: 'put',
    data
  })
}

// 删除简答题
export function delJd(id) {
  return request({
    url: '/businessCore/faShortAnswerQuestions/' + id,
    method: 'delete'
  })
}

// 获取简答题
export function getJd(id) {
  return request({
    url: '/businessCore/faShortAnswerQuestions/' + id,
    method: 'delete'
  })
}

// 导出简答题
export function exportJd(params, fileName) {
  const url = '/businessCore/faShortAnswerQuestions/export'
  download(
    url,
    params,
    fileName + `_${new Date().getTime()}.xlsx`
  )
}